<?php
/*
** @introduction: 后台会员首页
** @author: 杨陈鹏
** @date: 2015-03-25 20:06
** @email: yangchenpeng@cdlinglu.com
*/
namespace Admin\Controller\Member;

use Common\Controller\Admin\CommonController;

//use Think\Controller;
class IndexController extends CommonController
{

    /**
     * Introduction: 会员列表
     * @author: 杨陈鹏
     * @date: 2016/4/05 16:04
     * @email: yangchenpeng@cdlinglu.com
     */
    public function lists()
    {

        $logic = D('Common/Member', 'Logic');

        $this->page = I('post.page') ? I('post.page') : 1;

        $this->nums = 5;


        $limit = ($this->page - 1) . ',' . $this->nums;

        $this->where = I('post.where') ? I('post.where') : '';

        $fields = '*';

        $this->order = I('post.order') ? I('post.order') : 'create_time desc';

        $this->data = $logic::getData($this->where, $limit, $fields, $this->order);

        $this->total = $this->data['total'];
        $this->data = $this->data['data'];

        $this->display();

    }

    /**
     * Introduction: 创建会员
     * @author: 杨陈鹏
     * @date: 2016/4/05 16:04
     * @email: yangchenpeng@cdlinglu.com
     */
    public function create()
    {

        $data = I('post.data');

        $logic = D('Common/Member', 'Logic');

        if ($data) {

            $this->ajaxReturn($logic::create($data));

        } else {

            $this->display();

        }

    }
}